<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/template.xhtml">
	<ui:define name="title">Profile</ui:define>
	<ui:define name="content">
		<div id="head" align="center">
			<h:outputText value="#{label.profile}" style="font-size: 30px;" />
			<hr></hr>
		</div>
﻿		<h:form id="userProfileForm">
			<table>
				<tr>
					<td><h:outputText value="#{label.role}" /></td>
					<td><h:inputText value="#{userAction.targetEntity.role}"
							id="role" readonly="true">
						</h:inputText></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.name}" /></td>
					<td><h:inputText value="#{userAction.targetEntity.name}"
							id="name" required="true">
							<f:validateLength for="name" minimum="2" maximum="25" />
							<f:validateRequired />
							<rich:validator />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="name" errorClass="error" />
					</td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.middleName}" /></td>
					<td><h:inputText value="#{userAction.targetEntity.middleName}"
							id="middleName" required="true">
							<f:validateLength for="middleName" minimum="2" maximum="25" />
							<f:validateRequired />
							<rich:validator />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="middleName"
							errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.lastName}" /></td>
					<td><h:inputText value="#{userAction.targetEntity.lastName}"
							id="lastName" required="true">
							<f:validateLength for="lastName" minimum="2" maximum="25" />
							<f:validateRequired />
							<rich:validator />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="lastName"
							errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.email}" /></td>
					<td><h:inputText value="#{userAction.targetEntity.email}"
							required="true" id="email"
							validatorMessage="#{message.invalidEmail}">
							<f:validateRegex
								pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$"></f:validateRegex>
							<rich:validator />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="email" errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.oldPassword}" /></td>
					<td><h:inputSecret value="#{userAction.oldPassword}"
							id="oldPassword">
							<f:validateRequired />
							<rich:validator />
						</h:inputSecret></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="oldPassword"
							errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.password}" /></td>
					<td><h:inputSecret value="#{userAction.password}"
							id="password" binding="#{password}">
							<f:validateRequired />
							<rich:validator />
						</h:inputSecret></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="password"
							errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.confirmPassword}" /></td>
					<td><h:inputSecret value="#{userAction.confirmPassword}"
							id="confirmPassword">
							<f:validator for="confirmPassword"
								validatorId="equalPasswordsValidator" />
							<f:attribute name="passwordFiled" value="#{password}" />
							<f:validateRequired />
							<rich:validator />
						</h:inputSecret></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="confirmPassword"
							errorClass="error" /></td>
				</tr>
				<tr>
					<td><h:commandButton action="#{userAction.saveProfile}"
							value="#{label.save}" /></td>
					<td><rich:message for="userProfileForm"
							infoStyle="color: green;" errorStyle="color: red;"
							styleClass="errorMessage" /></td>
				</tr>
			</table>
﻿</h:form>
﻿</ui:define>
</ui:composition>
</html>